package org.zfes.snowier.zbss.xzy.router.others;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.zbss.xzy.biz.config.model.ConfigCateDevice;
import org.zfes.snowier.zbss.xzy.biz.config.service.IConfigCateDeviceService;
@Controller 
@RequestMapping("/xzy/aIConfigCateDevice")
public class AIConfigCateDeviceController implements BaseController {

	
	@Autowired
	private IConfigCateDeviceService aIConfigCateDeviceService;
	
    @RequestMapping(value="/loadAIConfigCateDeviceDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object loadAIConfigCateDeviceDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  aIConfigCateDeviceService.loadAIConfigCateDeviceDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
    @RequestMapping(value="/createAIConfigCateDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public  @ResponseBody Object createAIConfigCateDevice(ConfigCateDevice aIConfigCateDevice){
		aIConfigCateDeviceService.createAIConfigCateDevice(aIConfigCateDevice);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/loadAIConfigCateDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object loadAIConfigCateDevice(Long id){
		Optional<ConfigCateDevice> ops = aIConfigCateDeviceService.loadAIConfigCateDeviceById(id);
		return ajaxQuery("aIConfigCateDevice",ops);
    }
	
    @RequestMapping(value="/updateAIConfigCateDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object updateAIConfigCateDevice(ConfigCateDevice aIConfigCateDevice){
		aIConfigCateDeviceService.updateAIConfigCateDevice(aIConfigCateDevice);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
    @RequestMapping(value="/deleteAIConfigCateDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody  Object deleteAIConfigCateDevice(Long id){
		aIConfigCateDeviceService.deleteAIConfigCateDevice(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}